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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
g = C("g")
b = D("b")
i = E("i")
m = E("m")

k.u = g
k.r = g
k.y = i
k.o = b
c.s = b
g.s = i
g.w = i
g.z = m
b.t = i
i.t = b
i.w = k
i.v = m
m.t = b
m.w = k
m.v = i
assert k.u.s.t.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: E = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
g = C("g")
b = D("b")
i = E("i")
m = E("m")

k.u = g
k.r = g
k.y = i
k.o = b
c.s = b
g.s = i
g.w = i
g.z = m
b.t = i
i.t = b
i.w = k
i.v = m
m.t = b
m.w = k
m.v = i
assert k.u.s.t.t.v.t.txt == "b"