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

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

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

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

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

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

c.u = n
c.q = n
c.v = k
k.o = b
n.x = c
j.t = n
j.u = c
b.w = j
assert n.x.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

c.u = n
c.q = n
c.v = k
k.o = b
n.x = c
j.t = n
j.u = c
b.w = j
assert n.x.v.o.txt == "b"