class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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