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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: H = None
        self.o: H = None
        self.p: I = None
        self.u: A = None
        self.x: I = None
        self.txt = txt

a = A("a")
c = B("c")
f = C("f")
l = D("l")
e = E("e")
i = F("i")
m = G("m")
g = H("g")
h = I("h")
n = J("n")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: H = None
        self.o: H = None
        self.p: I = None
        self.u: A = None
        self.x: I = None
        self.txt = txt

a = A("a")
c = B("c")
f = C("f")
l = D("l")
e = E("e")
i = F("i")
m = G("m")
g = H("g")
h = I("h")
n = J("n")

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