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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: E = None
        self.w: E = None
        self.r: H = None
        self.v: C = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: G = None
        self.v: C = None
        self.w: C = None
        self.u: D = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: D = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: C = None
        self.w: D = None
        self.v: G = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

h = A("h")
f = B("f")
b = C("b")
n = D("n")
l = E("l")
c = F("c")
e = G("e")
a = H("a")
m = I("m")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: E = None
        self.w: E = None
        self.r: H = None
        self.v: C = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: G = None
        self.v: C = None
        self.w: C = None
        self.u: D = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: D = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: C = None
        self.w: D = None
        self.v: G = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

h = A("h")
f = B("f")
b = C("b")
n = D("n")
l = E("l")
c = F("c")
e = G("e")
a = H("a")
m = I("m")

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