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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.y: G = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.y: G = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.txt = txt

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

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