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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

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