class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.s: B = None
        self.u: D = None
        self.z: G = None
        self.t: I = None
        self.p: G = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.s: H = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.o: D = None
        self.q: B = None
        self.u: C = None
        self.t: G = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: F = None
        self.t: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.s: H = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.o: D = None
        self.q: B = None
        self.u: C = None
        self.t: G = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: F = None
        self.t: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

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