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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: H = None
        self.u: C = None
        self.v: C = None
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.y: F = None
        self.x: G = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: H = None
        self.u: C = None
        self.v: C = None
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.y: F = None
        self.x: G = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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