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

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: C = None
        self.w: F = None
        self.t: I = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: E = None
        self.o: D = None
        self.s: A = None
        self.z: F = None
        self.x: I = None
        self.r: I = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.u: B = None
        self.s: E = None
        self.r: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: C = None
        self.w: F = None
        self.t: I = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: E = None
        self.o: D = None
        self.s: A = None
        self.z: F = None
        self.x: I = None
        self.r: I = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.u: B = None
        self.s: E = None
        self.r: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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