class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.r: F = None
        self.t: E = None
        self.x: I = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: G = None
        self.s: C = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: I = None
        self.q: E = None
        self.v: H = None
        self.w: G = None
        self.x: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.w: C = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.r: F = None
        self.t: E = None
        self.x: I = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: G = None
        self.s: C = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: I = None
        self.q: E = None
        self.v: H = None
        self.w: G = None
        self.x: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.w: C = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

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

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

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