class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

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

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

l.p = i
l.q = k
l.y = n
b.s = l
b.z = d
n.z = j
d.q = m
d.y = m
d.o = l
d.u = n
a.t = m
a.p = j
a.v = n
j.v = n
j.x = d
j.y = d
j.r = l
j.o = i
j.s = a
i.s = l
i.z = d
e.t = n
e.v = n
e.p = j
k.s = l
k.z = d
m.z = j
assert l.q.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

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

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

l.p = i
l.q = k
l.y = n
b.s = l
b.z = d
n.z = j
d.q = m
d.y = m
d.o = l
d.u = n
a.t = m
a.p = j
a.v = n
j.v = n
j.x = d
j.y = d
j.r = l
j.o = i
j.s = a
i.s = l
i.z = d
e.t = n
e.v = n
e.p = j
k.s = l
k.z = d
m.z = j
assert l.q.z.y.txt == "m"