class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: F = None
        self.q: F = None
        self.r: I = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: G = None
        self.r: G = None
        self.x: B = None
        self.u: B = None
        self.p: I = None
        self.y: I = None
        self.t: I = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.txt = txt

k = A("k")
b = B("b")
l = C("l")
f = D("f")
i = E("i")
n = F("n")
e = G("e")
g = H("g")
d = I("d")

k.y = b
k.u = i
k.w = i
k.s = g
b.s = k
b.v = f
b.r = l
l.s = d
l.r = d
l.w = n
l.q = n
f.o = l
i.s = f
i.p = f
i.q = b
i.o = e
i.x = n
i.v = n
n.q = k
n.p = b
n.r = l
e.z = n
e.v = k
e.t = f
e.q = f
e.p = f
e.r = f
e.x = d
e.u = i
g.z = d
g.p = d
g.y = d
g.t = d
g.v = e
g.r = e
g.x = b
g.u = b
g.s = k
d.t = e
d.u = n
assert i.q.r.w.q.w.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: F = None
        self.q: F = None
        self.r: I = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: G = None
        self.r: G = None
        self.x: B = None
        self.u: B = None
        self.p: I = None
        self.y: I = None
        self.t: I = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.txt = txt

k = A("k")
b = B("b")
l = C("l")
f = D("f")
i = E("i")
n = F("n")
e = G("e")
g = H("g")
d = I("d")

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