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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: C = None
        self.y: C = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

b = A("b")
f = B("f")
i = C("i")
j = D("j")
h = E("h")
c = C("c")
e = A("e")
g = D("g")
l = D("l")
n = A("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: C = None
        self.y: C = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

b = A("b")
f = B("f")
i = C("i")
j = D("j")
h = E("h")
c = C("c")
e = A("e")
g = D("g")
l = D("l")
n = A("n")

b.o = c
b.x = l
f.u = e
f.z = b
i.t = b
i.z = e
i.v = c
j.w = g
j.s = g
j.o = f
j.p = l
h.q = e
h.p = i
h.y = c
h.r = j
h.v = f
c.t = b
c.z = b
c.v = i
e.o = c
e.x = g
g.w = l
g.p = l
g.s = j
g.o = f
l.w = j
l.p = j
l.s = g
l.o = f
n.o = i
n.x = l
assert l.w.p.o.u.x.w.o.z.o.t.txt == "b"