class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: J = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: H = None
        self.r: G = None
        self.x: J = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.w: D = None
        self.s: A = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: J = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: H = None
        self.r: G = None
        self.x: J = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.w: D = None
        self.s: A = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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