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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: C = None
        self.x: F = None
        self.w: D = None
        self.y: E = None
        self.o: D = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.t: C = None
        self.z: D = None
        self.y: A = None
        self.v: E = None
        self.s: E = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.p: I = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: H = None
        self.y: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: C = None
        self.x: F = None
        self.w: D = None
        self.y: E = None
        self.o: D = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.t: C = None
        self.z: D = None
        self.y: A = None
        self.v: E = None
        self.s: E = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.p: I = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: H = None
        self.y: E = None
        self.txt = txt

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

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