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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.o: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
j = C("j")
b = D("b")
k = E("k")
d = A("d")
f = C("f")

g.t = b
g.u = k
g.w = k
e.x = f
e.o = b
e.y = g
j.y = e
j.p = e
j.o = e
j.x = k
j.z = f
b.y = d
b.r = d
b.w = k
k.x = b
d.t = b
d.u = k
d.w = k
f.y = e
f.p = e
f.o = e
f.x = k
f.z = j
assert b.r.t.w.x.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.o: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
j = C("j")
b = D("b")
k = E("k")
d = A("d")
f = C("f")

g.t = b
g.u = k
g.w = k
e.x = f
e.o = b
e.y = g
j.y = e
j.p = e
j.o = e
j.x = k
j.z = f
b.y = d
b.r = d
b.w = k
k.x = b
d.t = b
d.u = k
d.w = k
f.y = e
f.p = e
f.o = e
f.x = k
f.z = j
assert b.r.t.w.x.r.u.txt == "k"