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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.v: C = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

c.r = i
g.v = e
g.o = i
g.x = i
g.t = b
f.r = g
m.y = i
m.z = l
m.v = f
m.x = c
m.s = c
e.w = j
e.r = j
e.z = c
e.u = i
i.w = m
i.r = m
i.z = c
i.u = b
a.r = l
b.w = j
b.r = j
b.z = c
b.u = e
l.v = i
l.x = i
l.o = b
l.t = e
j.y = i
j.z = l
j.v = a
j.x = c
j.s = c
assert a.r.o.r.s.r.u.w.v.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.v: C = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

c.r = i
g.v = e
g.o = i
g.x = i
g.t = b
f.r = g
m.y = i
m.z = l
m.v = f
m.x = c
m.s = c
e.w = j
e.r = j
e.z = c
e.u = i
i.w = m
i.r = m
i.z = c
i.u = b
a.r = l
b.w = j
b.r = j
b.z = c
b.u = e
l.v = i
l.x = i
l.o = b
l.t = e
j.y = i
j.z = l
j.v = a
j.x = c
j.s = c
assert a.r.o.r.s.r.u.w.v.r.o.txt == "b"