class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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