class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: G = None
        self.r: G = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: F = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: A = None
        self.u: I = None
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: B = None
        self.t: I = None
        self.y: I = None
        self.z: D = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.w: B = None
        self.t: H = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: F = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: A = None
        self.u: I = None
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: B = None
        self.t: I = None
        self.y: I = None
        self.z: D = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.w: B = None
        self.t: H = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: G = None
        self.txt = txt

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

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