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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.o: A = None
        self.q: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.u: D = None
        self.s: D = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.o: A = None
        self.q: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.u: D = None
        self.s: D = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

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

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