class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.y: F = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.y: D = None
        self.z: A = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.o: B = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: C = None
        self.p: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.txt = txt

n = A("n")
l = B("l")
e = C("e")
a = D("a")
m = E("m")
j = F("j")

n.q = m
n.s = e
n.x = e
n.y = j
l.u = a
l.p = n
e.o = j
e.w = j
e.p = n
e.z = n
e.y = a
e.q = a
a.q = e
a.y = n
a.o = l
a.s = l
a.v = m
m.t = j
m.o = e
m.p = n
m.u = n
j.x = e
j.p = m
assert l.p.q.p.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.y: F = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.y: D = None
        self.z: A = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.o: B = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: C = None
        self.p: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.txt = txt

n = A("n")
l = B("l")
e = C("e")
a = D("a")
m = E("m")
j = F("j")

n.q = m
n.s = e
n.x = e
n.y = j
l.u = a
l.p = n
e.o = j
e.w = j
e.p = n
e.z = n
e.y = a
e.q = a
a.q = e
a.y = n
a.o = l
a.s = l
a.v = m
m.t = j
m.o = e
m.p = n
m.u = n
j.x = e
j.p = m
assert l.p.q.p.x.y.txt == "a"