class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.v: C = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: J = None
        self.x: G = None
        self.p: D = None
        self.u: G = None
        self.z: D = None
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: F = 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.z: B = None
        self.t: B = None
        self.p: B = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: J = None
        self.x: G = None
        self.p: D = None
        self.u: G = None
        self.z: D = None
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: F = 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.z: B = None
        self.t: B = None
        self.p: B = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

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

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