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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: I = None
        self.p: A = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.v: G = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.z: D = None
        self.x: A = None
        self.w: B = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: I = None
        self.p: A = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.v: G = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.z: D = None
        self.x: A = None
        self.w: B = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

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

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