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

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

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

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

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

c = A("c")
e = B("e")
b = C("b")
k = D("k")
g = E("g")
l = D("l")

c.x = b
c.s = b
c.t = g
e.t = c
b.y = e
k.q = c
k.t = c
k.z = l
k.y = e
g.u = k
g.y = k
g.o = c
l.q = c
l.t = c
l.z = k
l.y = e
assert b.y.t.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

c = A("c")
e = B("e")
b = C("b")
k = D("k")
g = E("g")
l = D("l")

c.x = b
c.s = b
c.t = g
e.t = c
b.y = e
k.q = c
k.t = c
k.z = l
k.y = e
g.u = k
g.y = k
g.o = c
l.q = c
l.t = c
l.z = k
l.y = e
assert b.y.t.t.y.txt == "k"