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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.p: B = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.p: B = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

m.o = l
m.v = g
m.u = a
j.q = b
j.w = b
j.p = m
j.r = l
l.o = m
l.x = k
k.x = g
i.u = b
i.r = b
i.y = l
i.p = j
i.w = e
b.q = j
b.w = j
b.p = m
b.r = l
a.u = b
a.p = b
a.y = l
a.w = e
a.r = j
g.x = k
e.u = j
e.r = j
e.y = l
e.p = b
e.w = a
assert j.p.u.r.p.u.u.txt == "b"