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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.v: B = None
        self.x: C = None
        self.s: E = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.t: E = None
        self.r: D = None
        self.v: C = None
        self.x: F = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.v: B = None
        self.x: C = None
        self.s: E = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.t: E = None
        self.r: D = None
        self.v: C = None
        self.x: F = None
        self.p: D = None
        self.txt = txt

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

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