class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.y: E = None
        self.p: E = None
        self.z: G = None
        self.r: G = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: E = None
        self.z: G = None
        self.x: F = None
        self.o: H = None
        self.y: D = None
        self.q: G = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.t: C = None
        self.p: A = None
        self.s: B = None
        self.u: C = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: A = None
        self.w: I = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.w: B = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: I = None
        self.o: D = None
        self.y: I = None
        self.t: H = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: I = None
        self.u: G = None
        self.y: A = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: C = None
        self.o: B = None
        self.t: G = None
        self.p: H = None
        self.q: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

n.u = i
n.q = g
m.w = l
m.x = l
m.y = l
m.p = l
m.z = i
m.r = i
m.t = k
d.p = i
d.z = i
d.q = i
d.r = l
d.x = k
d.o = g
d.y = c
d.t = h
c.y = g
c.z = g
c.q = g
c.t = d
c.u = d
c.v = d
c.p = n
c.s = m
l.t = h
l.w = h
l.p = n
l.y = k
k.x = n
k.q = d
k.w = m
k.t = m
k.s = l
i.q = k
i.w = h
i.y = h
i.o = c
i.t = g
i.s = d
g.q = c
g.x = h
g.u = i
g.y = n
g.z = n
g.o = l
h.s = n
h.y = n
h.r = d
h.o = m
h.t = i
h.p = g
h.q = l
h.z = l
assert l.p.u.q.s.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.y: E = None
        self.p: E = None
        self.z: G = None
        self.r: G = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: E = None
        self.z: G = None
        self.x: F = None
        self.o: H = None
        self.y: D = None
        self.q: G = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.t: C = None
        self.p: A = None
        self.s: B = None
        self.u: C = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: A = None
        self.w: I = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.w: B = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: I = None
        self.o: D = None
        self.y: I = None
        self.t: H = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: I = None
        self.u: G = None
        self.y: A = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: C = None
        self.o: B = None
        self.t: G = None
        self.p: H = None
        self.q: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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