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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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