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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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