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

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

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

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

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

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

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

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

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

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

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

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

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