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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.v: A = None
        self.q: B = None
        self.y: A = None
        self.u: D = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.u: A = None
        self.q: H = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

e.q = m
e.t = m
e.z = c
e.v = a
e.r = d
h.v = k
k.p = i
k.v = i
k.y = i
k.t = d
k.q = h
k.u = m
k.o = e
m.x = e
m.z = c
m.r = h
m.p = k
m.v = d
d.x = k
d.u = k
d.v = a
a.r = i
a.p = i
a.x = k
a.y = k
a.u = e
a.q = g
c.t = m
b.r = c
b.z = c
b.t = e
b.x = d
i.q = m
i.t = m
i.z = c
i.v = a
i.r = d
g.r = c
g.z = c
g.t = i
g.x = d
assert b.t.z.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.v: F = None
        self.r: E = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.v: A = None
        self.q: B = None
        self.y: A = None
        self.u: D = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.u: A = None
        self.q: H = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

e.q = m
e.t = m
e.z = c
e.v = a
e.r = d
h.v = k
k.p = i
k.v = i
k.y = i
k.t = d
k.q = h
k.u = m
k.o = e
m.x = e
m.z = c
m.r = h
m.p = k
m.v = d
d.x = k
d.u = k
d.v = a
a.r = i
a.p = i
a.x = k
a.y = k
a.u = e
a.q = g
c.t = m
b.r = c
b.z = c
b.t = e
b.x = d
i.q = m
i.t = m
i.z = c
i.v = a
i.r = d
g.r = c
g.z = c
g.t = i
g.x = d
assert b.t.z.t.r.txt == "h"