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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

e = A("e")
l = B("l")
n = C("n")
j = D("j")

e.p = l
e.w = l
e.o = j
l.v = n
n.r = e
n.x = e
n.o = j
j.y = n
j.x = n
j.r = e
j.u = l
assert j.u.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

e = A("e")
l = B("l")
n = C("n")
j = D("j")

e.p = l
e.w = l
e.o = j
l.v = n
n.r = e
n.x = e
n.o = j
j.y = n
j.x = n
j.r = e
j.u = l
assert j.u.v.o.txt == "j"