class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: D = None
        self.o: A = None
        self.t: H = None
        self.u: C = None
        self.r: G = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.u: F = None
        self.x: B = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.v: H = None
        self.r: B = None
        self.x: H = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.w: C = None
        self.u: H = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: D = None
        self.o: A = None
        self.t: H = None
        self.u: C = None
        self.r: G = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.u: F = None
        self.x: B = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.v: H = None
        self.r: B = None
        self.x: H = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.w: C = None
        self.u: H = None
        self.y: A = None
        self.txt = txt

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

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