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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

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

j.y = h
d.v = m
d.q = l
d.w = l
e.s = f
e.z = m
k.q = d
k.z = d
k.x = m
k.p = b
k.r = b
f.p = m
f.t = e
f.s = e
f.v = j
m.p = f
m.t = e
m.s = e
m.v = b
l.q = d
l.z = d
l.x = m
l.p = b
l.r = b
h.q = d
h.z = d
h.x = m
h.p = j
h.r = j
b.y = h
g.s = f
g.z = f
assert l.z.v.s.s.t.s.v.y.r.y.txt == "h"