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

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

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

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

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

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

c.o = b
b.v = j
b.p = j
j.x = b
j.s = n
f.r = j
n.w = c
n.u = b
assert c.o.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

c.o = b
b.v = j
b.p = j
j.x = b
j.s = n
f.r = j
n.w = c
n.u = b
assert c.o.v.x.p.txt == "j"