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

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

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

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

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

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

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

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

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

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

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

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

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