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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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