class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: G = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: J = None
        self.v: C = None
        self.x: A = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: J = None
        self.p: F = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: G = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: J = None
        self.v: C = None
        self.x: A = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: J = None
        self.p: F = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

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

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