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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.y: G = None
        self.q: H = None
        self.s: D = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.p: H = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.q: C = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

d = A("d")
c = B("c")
g = C("g")
e = D("e")
m = E("m")
l = F("l")
n = G("n")
a = H("a")
k = D("k")
f = C("f")

d.x = n
d.q = c
c.x = k
c.s = k
c.t = a
c.q = a
c.y = n
c.r = n
c.z = m
g.o = m
g.y = m
g.v = l
g.p = a
e.s = m
e.r = m
e.v = l
e.y = l
e.x = l
e.q = d
e.t = d
e.z = c
m.r = a
l.s = k
n.p = m
n.z = m
n.t = g
n.r = g
n.v = g
n.w = c
a.z = c
a.u = c
a.s = c
a.q = g
a.v = g
k.s = m
k.r = m
k.v = l
k.y = l
k.x = l
k.q = d
k.t = d
k.z = c
f.o = m
f.y = m
f.v = l
f.p = a
assert a.v.p.z.q.u.y.p.r.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.y: G = None
        self.q: H = None
        self.s: D = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.p: H = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.q: C = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

d = A("d")
c = B("c")
g = C("g")
e = D("e")
m = E("m")
l = F("l")
n = G("n")
a = H("a")
k = D("k")
f = C("f")

d.x = n
d.q = c
c.x = k
c.s = k
c.t = a
c.q = a
c.y = n
c.r = n
c.z = m
g.o = m
g.y = m
g.v = l
g.p = a
e.s = m
e.r = m
e.v = l
e.y = l
e.x = l
e.q = d
e.t = d
e.z = c
m.r = a
l.s = k
n.p = m
n.z = m
n.t = g
n.r = g
n.v = g
n.w = c
a.z = c
a.u = c
a.s = c
a.q = g
a.v = g
k.s = m
k.r = m
k.v = l
k.y = l
k.x = l
k.q = d
k.t = d
k.z = c
f.o = m
f.y = m
f.v = l
f.p = a
assert a.v.p.z.q.u.y.p.r.u.z.txt == "m"