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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

m = A("m")
b = B("b")
l = C("l")
i = D("i")
a = E("a")
g = F("g")
d = G("d")
c = H("c")

m.o = a
m.p = a
m.w = d
m.r = g
m.s = i
b.s = d
b.p = g
l.x = d
l.p = a
l.w = g
i.u = d
a.q = l
a.x = i
a.w = g
g.r = m
g.u = m
g.x = m
g.s = m
g.z = b
g.y = a
g.p = d
g.v = d
d.r = l
d.w = c
c.u = g
assert m.o.q.w.p.w.u.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.w: G = None
        self.r: F = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

m = A("m")
b = B("b")
l = C("l")
i = D("i")
a = E("a")
g = F("g")
d = G("d")
c = H("c")

m.o = a
m.p = a
m.w = d
m.r = g
m.s = i
b.s = d
b.p = g
l.x = d
l.p = a
l.w = g
i.u = d
a.q = l
a.x = i
a.w = g
g.r = m
g.u = m
g.x = m
g.s = m
g.z = b
g.y = a
g.p = d
g.v = d
d.r = l
d.w = c
c.u = g
assert m.o.q.w.p.w.u.v.r.txt == "l"