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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.r: E = None
        self.o: E = None
        self.z: I = None
        self.y: D = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.p: A = None
        self.w: J = None
        self.t: A = None
        self.v: B = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: J = None
        self.v: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.r: E = None
        self.o: E = None
        self.z: I = None
        self.y: D = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.p: A = None
        self.w: J = None
        self.t: A = None
        self.v: B = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: J = None
        self.v: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

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

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