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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: A = None
        self.s: C = None
        self.x: F = None
        self.q: B = None
        self.t: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: A = None
        self.s: C = None
        self.x: F = None
        self.q: B = None
        self.t: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: H = None
        self.txt = txt

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

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