class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: F = None
        self.w: I = None
        self.x: G = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: I = None
        self.y: H = None
        self.p: G = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.t: J = None
        self.v: B = None
        self.r: J = None
        self.y: D = None
        self.u: B = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: I = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

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

h = A("h")
n = B("n")
k = C("k")
g = D("g")
i = E("i")
f = F("f")
b = G("b")
j = H("j")
l = I("l")
a = J("a")

h.t = f
h.z = f
h.w = l
h.p = l
h.x = b
h.r = a
n.z = l
n.v = i
n.t = h
k.t = b
k.x = f
g.x = k
g.q = l
g.y = j
g.p = b
g.r = i
i.p = g
i.q = g
i.x = b
f.s = l
f.o = i
f.t = a
f.r = a
f.w = a
f.v = n
f.u = n
f.y = g
b.t = h
b.v = l
b.o = f
b.w = g
j.u = i
l.t = k
l.x = f
l.v = f
l.s = g
a.q = n
a.u = b
a.v = f
a.w = k
assert k.t.v.s.q.s.x.t.w.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: F = None
        self.w: I = None
        self.x: G = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: I = None
        self.y: H = None
        self.p: G = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.t: J = None
        self.v: B = None
        self.r: J = None
        self.y: D = None
        self.u: B = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: I = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

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

h = A("h")
n = B("n")
k = C("k")
g = D("g")
i = E("i")
f = F("f")
b = G("b")
j = H("j")
l = I("l")
a = J("a")

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