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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.v: E = None
        self.q: B = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: C = None
        self.z: B = None
        self.u: G = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: D = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.v: E = None
        self.q: B = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: C = None
        self.z: B = None
        self.u: G = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: D = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

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

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