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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: C = None
        self.u: A = None
        self.t: D = None
        self.v: F = None
        self.o: A = None
        self.s: A = None
        self.y: E = None
        self.r: J = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: C = None
        self.u: A = None
        self.t: D = None
        self.v: F = None
        self.o: A = None
        self.s: A = None
        self.y: E = None
        self.r: J = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

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