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

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

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

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

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

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

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

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

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

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

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

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

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