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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.txt = txt

e = A("e")
k = B("k")
j = C("j")
m = D("m")
h = E("h")
a = F("a")
c = B("c")
f = D("f")
d = D("d")
b = F("b")

e.x = f
e.q = k
e.z = d
e.u = d
k.z = m
k.u = f
k.x = h
j.o = e
m.t = c
m.y = a
h.r = e
h.t = a
h.u = d
h.w = f
a.s = b
a.r = b
c.z = d
c.u = m
c.x = h
f.t = k
f.y = a
d.t = k
d.y = a
b.s = a
b.r = a
assert k.z.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.txt = txt

e = A("e")
k = B("k")
j = C("j")
m = D("m")
h = E("h")
a = F("a")
c = B("c")
f = D("f")
d = D("d")
b = F("b")

e.x = f
e.q = k
e.z = d
e.u = d
k.z = m
k.u = f
k.x = h
j.o = e
m.t = c
m.y = a
h.r = e
h.t = a
h.u = d
h.w = f
a.s = b
a.r = b
c.z = d
c.u = m
c.x = h
f.t = k
f.y = a
d.t = k
d.y = a
b.s = a
b.r = a
assert k.z.t.u.txt == "m"