class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: H = None
        self.q: G = None
        self.w: E = None
        self.p: G = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.q: E = None
        self.v: B = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.t: H = None
        self.s: D = None
        self.z: H = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: E = None
        self.p: I = None
        self.x: G = None
        self.z: I = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.z: D = None
        self.t: B = None
        self.p: F = None
        self.w: A = None
        self.u: I = None
        self.y: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: H = None
        self.z: H = None
        self.r: H = None
        self.u: I = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
m = D("m")
d = E("d")
n = F("n")
g = G("g")
c = H("c")
j = I("j")
b = I("b")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.q: E = None
        self.v: B = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.t: H = None
        self.s: D = None
        self.z: H = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: E = None
        self.p: I = None
        self.x: G = None
        self.z: I = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.z: D = None
        self.t: B = None
        self.p: F = None
        self.w: A = None
        self.u: I = None
        self.y: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: H = None
        self.z: H = None
        self.r: H = None
        self.u: I = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
m = D("m")
d = E("d")
n = F("n")
g = G("g")
c = H("c")
j = I("j")
b = I("b")

a.u = j
a.s = c
a.q = g
a.p = g
a.w = d
a.x = d
h.o = n
h.s = n
h.t = g
h.v = c
h.q = c
h.p = a
h.z = d
f.z = m
f.p = c
m.w = a
m.r = n
m.q = d
m.v = h
m.o = h
d.q = h
d.r = g
d.x = g
d.t = c
d.z = c
d.s = m
n.v = g
n.x = g
n.y = d
n.q = d
n.p = b
n.z = b
n.u = f
g.r = a
g.w = a
g.o = n
g.p = n
g.z = m
g.t = h
g.u = b
g.y = c
c.x = a
c.q = n
c.s = d
c.w = b
j.w = c
j.v = c
j.z = c
j.r = c
j.u = b
b.w = c
b.v = c
b.z = c
b.r = c
b.u = j
assert c.s.x.p.u.p.x.q.p.txt == "n"