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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: E = None
        self.v: A = None
        self.w: B = None
        self.q: F = None
        self.s: E = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
c = B("c")
i = C("i")
n = D("n")
b = E("b")
h = F("h")
k = G("k")
e = H("e")
f = H("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: E = None
        self.v: A = None
        self.w: B = None
        self.q: F = None
        self.s: E = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
c = B("c")
i = C("i")
n = D("n")
b = E("b")
h = F("h")
k = G("k")
e = H("e")
f = H("f")

m.q = h
m.y = c
m.o = i
m.w = b
m.p = f
c.z = h
c.y = k
i.p = b
i.s = m
i.x = k
i.q = c
n.r = m
b.q = m
b.x = k
b.w = h
b.z = h
b.p = i
b.t = c
h.z = f
h.o = f
h.p = e
h.w = b
h.y = n
h.r = i
h.x = k
h.s = c
k.o = f
k.x = b
k.s = b
k.v = m
k.w = c
k.q = h
k.t = h
e.s = c
e.z = k
e.u = m
f.s = c
f.z = k
f.u = m
assert i.p.p.p.p.x.q.r.x.q.txt == "h"