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

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

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

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

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

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

l.v = f
l.w = i
l.y = d
l.t = g
d.q = l
d.x = e
b.p = d
b.v = i
b.r = i
j.o = l
j.t = e
j.w = g
j.r = k
j.z = d
f.u = e
i.p = d
i.v = b
i.r = b
k.o = l
k.t = d
k.z = d
k.w = g
k.r = j
g.v = f
g.w = i
g.y = d
g.t = l
e.q = l
e.x = d
assert j.r.o.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

l.v = f
l.w = i
l.y = d
l.t = g
d.q = l
d.x = e
b.p = d
b.v = i
b.r = i
j.o = l
j.t = e
j.w = g
j.r = k
j.z = d
f.u = e
i.p = d
i.v = b
i.r = b
k.o = l
k.t = d
k.z = d
k.w = g
k.r = j
g.v = f
g.w = i
g.y = d
g.t = l
e.q = l
e.x = d
assert j.r.o.w.r.txt == "b"