class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: F = None
        self.p: F = None
        self.o: H = None
        self.u: G = None
        self.y: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: D = None
        self.w: A = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.p: F = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: D = None
        self.w: A = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.p: F = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

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

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