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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.p: B = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.z: C = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.w: A = None
        self.p: D = None
        self.t: A = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.p: B = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.z: C = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.w: A = None
        self.p: D = None
        self.t: A = None
        self.q: F = None
        self.txt = txt

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

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