class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.z: B = None
        self.p: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
k = B("k")
m = C("m")
e = D("e")
j = E("j")
i = F("i")
d = B("d")

f.r = i
f.t = e
f.z = k
f.p = k
f.q = m
k.t = j
k.z = i
m.w = k
m.o = j
e.v = m
e.u = m
e.s = i
j.o = m
j.y = d
j.p = i
j.v = i
i.y = d
d.t = j
d.z = i
assert k.t.y.t.y.z.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.z: B = None
        self.p: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
k = B("k")
m = C("m")
e = D("e")
j = E("j")
i = F("i")
d = B("d")

f.r = i
f.t = e
f.z = k
f.p = k
f.q = m
k.t = j
k.z = i
m.w = k
m.o = j
e.v = m
e.u = m
e.s = i
j.o = m
j.y = d
j.p = i
j.v = i
i.y = d
d.t = j
d.z = i
assert k.t.y.t.y.z.y.t.txt == "j"