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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: E = None
        self.z: D = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: A = None
        self.q: E = None
        self.v: J = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: I = None
        self.x: H = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.t: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.u: B = None
        self.o: I = None
        self.z: H = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: E = None
        self.z: D = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: A = None
        self.q: E = None
        self.v: J = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: I = None
        self.x: H = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.t: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.u: B = None
        self.o: I = None
        self.z: H = None
        self.v: D = None
        self.txt = txt

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

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