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

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

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

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

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

k = A("k")
g = B("g")
f = C("f")
c = D("c")
n = E("n")
d = A("d")
b = D("b")

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

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

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

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

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

k = A("k")
g = B("g")
f = C("f")
c = D("c")
n = E("n")
d = A("d")
b = D("b")

k.t = g
k.r = f
k.z = b
k.u = b
g.o = n
g.w = f
g.v = f
f.y = b
f.z = n
f.t = g
c.x = n
c.v = f
c.z = d
n.o = f
n.u = k
d.t = g
d.r = f
d.z = b
d.u = b
b.x = n
b.v = f
b.z = k
assert n.u.r.z.u.r.txt == "f"