class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.s: D = None
        self.x: I = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.q: D = None
        self.z: H = None
        self.t: F = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: A = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.z: C = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.v: B = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.q: D = None
        self.z: H = None
        self.t: F = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: A = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.z: C = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.v: B = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

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