なんじゃもんじゃではありませんでした
nanja monjadewārimasendeshita

Noun
Desu Copula

The polite, past negative form of 何じゃもんじゃ

1. Was not/were not (a rough, colloquial way of saying); ; Was not/were not (doing something foolish or nonsensical)

Past/Perfective
Negative
Polite
Formal Register