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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.w: C = None
        self.x: D = None
        self.p: A = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

k = A("k")
e = B("e")
h = C("h")
d = D("d")
g = E("g")
j = F("j")
b = G("b")
c = H("c")
n = I("n")

k.o = b
k.t = e
e.r = h
e.w = h
e.q = j
e.x = d
e.p = k
e.z = c
h.z = c
h.o = g
h.t = d
d.p = h
d.w = b
g.z = b
g.u = b
g.w = d
g.s = e
g.y = j
j.q = c
j.x = n
j.p = k
b.s = d
b.q = h
c.q = h
c.t = d
c.p = j
n.t = e
n.x = j
n.y = k
assert g.u.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.w: C = None
        self.x: D = None
        self.p: A = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

k = A("k")
e = B("e")
h = C("h")
d = D("d")
g = E("g")
j = F("j")
b = G("b")
c = H("c")
n = I("n")

k.o = b
k.t = e
e.r = h
e.w = h
e.q = j
e.x = d
e.p = k
e.z = c
h.z = c
h.o = g
h.t = d
d.p = h
d.w = b
g.z = b
g.u = b
g.w = d
g.s = e
g.y = j
j.q = c
j.x = n
j.p = k
b.s = d
b.q = h
c.q = h
c.t = d
c.p = j
n.t = e
n.x = j
n.y = k
assert g.u.s.p.txt == "h"