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

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

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

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

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

k = A("k")
n = B("n")
c = C("c")
l = D("l")
i = E("i")
j = E("j")

k.t = i
k.w = i
k.r = c
k.p = c
k.y = n
n.y = k
c.x = l
c.z = k
l.x = k
l.r = k
l.z = k
l.o = c
i.p = c
j.p = c
assert j.p.x.x.p.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.r: C = None
        self.p: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

k = A("k")
n = B("n")
c = C("c")
l = D("l")
i = E("i")
j = E("j")

k.t = i
k.w = i
k.r = c
k.p = c
k.y = n
n.y = k
c.x = l
c.z = k
l.x = k
l.r = k
l.z = k
l.o = c
i.p = c
j.p = c
assert j.p.x.x.p.x.o.txt == "c"