class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.r: D = None
        self.s: E = None
        self.p: A = None
        self.q: I = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: B = None
        self.w: I = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.r: D = None
        self.s: E = None
        self.p: A = None
        self.q: I = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: B = None
        self.w: I = None
        self.v: B = None
        self.txt = txt

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

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