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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

f.y = b
f.r = l
f.p = l
f.w = n
f.q = h
d.o = h
d.t = l
d.u = b
j.x = b
l.o = f
b.y = h
b.o = h
b.r = a
b.w = n
i.q = l
i.z = l
i.u = j
a.y = m
a.o = j
a.r = b
a.w = n
n.q = l
n.z = l
n.u = h
h.x = b
m.x = b
assert a.o.x.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.p: D = None
        self.w: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

f.y = b
f.r = l
f.p = l
f.w = n
f.q = h
d.o = h
d.t = l
d.u = b
j.x = b
l.o = f
b.y = h
b.o = h
b.r = a
b.w = n
i.q = l
i.z = l
i.u = j
a.y = m
a.o = j
a.r = b
a.w = n
n.q = l
n.z = l
n.u = h
h.x = b
m.x = b
assert a.o.x.w.q.txt == "l"