class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: D = None
        self.y: H = None
        self.q: D = None
        self.w: D = None
        self.p: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.s: D = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: D = None
        self.y: H = None
        self.q: D = None
        self.w: D = None
        self.p: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.s: D = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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