class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: B = None
        self.u: F = None
        self.s: D = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: H = None
        self.w: G = None
        self.p: B = None
        self.x: B = None
        self.v: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: I = None
        self.y: A = None
        self.s: I = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: B = None
        self.u: F = None
        self.s: D = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: H = None
        self.w: G = None
        self.p: B = None
        self.x: B = None
        self.v: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: I = None
        self.y: A = None
        self.s: I = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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