class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.z: C = None
        self.s: D = None
        self.u: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: B = None
        self.u: F = None
        self.r: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.p: E = None
        self.o: B = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: A = None
        self.q: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: B = None
        self.u: F = None
        self.r: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.p: E = None
        self.o: B = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: A = None
        self.q: F = None
        self.txt = txt

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

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

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