class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.u: F = None
        self.v: H = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.y: A = None
        self.s: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: A = None
        self.x: H = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.y: A = None
        self.s: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: A = None
        self.x: H = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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