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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.s: C = None
        self.t: D = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.v: C = None
        self.s: B = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.y: B = None
        self.r: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.s: C = None
        self.t: D = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.v: C = None
        self.s: B = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.y: B = None
        self.r: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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