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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.t: A = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

b = A("b")
j = B("j")
f = C("f")
l = D("l")
g = E("g")
c = C("c")
d = A("d")
a = A("a")
n = D("n")

b.o = n
j.v = a
f.w = d
f.o = g
f.z = b
l.p = g
l.w = d
l.r = n
g.y = j
g.s = j
g.x = a
g.t = d
g.w = d
c.w = d
c.z = d
c.o = g
d.o = n
a.o = l
n.p = g
n.w = b
n.r = l
assert n.r.w.o.p.x.o.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.t: A = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

b = A("b")
j = B("j")
f = C("f")
l = D("l")
g = E("g")
c = C("c")
d = A("d")
a = A("a")
n = D("n")

b.o = n
j.v = a
f.w = d
f.o = g
f.z = b
l.p = g
l.w = d
l.r = n
g.y = j
g.s = j
g.x = a
g.t = d
g.w = d
c.w = d
c.z = d
c.o = g
d.o = n
a.o = l
n.p = g
n.w = b
n.r = l
assert n.r.w.o.p.x.o.r.r.txt == "l"