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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.v: E = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

d = A("d")
j = B("j")
e = C("e")
k = D("k")
g = E("g")
l = D("l")

d.o = e
d.p = e
j.o = d
j.p = k
j.v = e
e.o = j
e.x = g
k.w = l
k.r = g
k.v = g
k.s = g
k.o = e
g.w = j
g.v = k
g.x = e
l.w = k
l.r = g
l.v = g
l.s = g
l.o = e
assert e.o.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.v: E = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

d = A("d")
j = B("j")
e = C("e")
k = D("k")
g = E("g")
l = D("l")

d.o = e
d.p = e
j.o = d
j.p = k
j.v = e
e.o = j
e.x = g
k.w = l
k.r = g
k.v = g
k.s = g
k.o = e
g.w = j
g.v = k
g.x = e
l.w = k
l.r = g
l.v = g
l.s = g
l.o = e
assert e.o.o.p.txt == "e"