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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: H = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: F = None
        self.u: E = None
        self.t: C = None
        self.r: G = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

l = A("l")
j = B("j")
g = C("g")
c = D("c")
k = E("k")
f = F("f")
n = G("n")
d = H("d")
i = F("i")
m = E("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: H = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: F = None
        self.u: E = None
        self.t: C = None
        self.r: G = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

l = A("l")
j = B("j")
g = C("g")
c = D("c")
k = E("k")
f = F("f")
n = G("n")
d = H("d")
i = F("i")
m = E("m")

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