class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: H = None
        self.t: H = None
        self.w: F = None
        self.s: F = None
        self.v: C = None
        self.x: D = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.v: A = None
        self.y: F = None
        self.w: D = None
        self.x: F = None
        self.s: D = None
        self.z: J = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.y: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: I = None
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: F = None
        self.v: A = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.v: A = None
        self.y: F = None
        self.w: D = None
        self.x: F = None
        self.s: D = None
        self.z: J = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.y: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: I = None
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: F = None
        self.v: A = None
        self.s: H = None
        self.txt = txt

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

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