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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.w: C = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.u: B = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: F = None
        self.p: A = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
b = C("b")
m = D("m")
e = E("e")
g = F("g")
i = G("i")
n = H("n")
f = F("f")

h.x = e
h.p = i
h.z = b
h.y = n
a.y = e
a.q = m
a.w = b
a.p = g
a.t = h
b.w = h
b.x = i
b.q = m
m.o = g
m.r = h
m.p = a
e.z = a
e.u = a
e.t = a
e.w = b
e.v = g
g.t = i
g.r = f
g.p = h
i.o = e
i.w = f
i.p = m
i.t = a
n.o = h
n.u = m
f.t = i
f.r = g
f.p = h
assert f.t.t.q.r.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: G = None
        self.z: C = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.w: C = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.u: B = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: F = None
        self.p: A = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
b = C("b")
m = D("m")
e = E("e")
g = F("g")
i = G("i")
n = H("n")
f = F("f")

h.x = e
h.p = i
h.z = b
h.y = n
a.y = e
a.q = m
a.w = b
a.p = g
a.t = h
b.w = h
b.x = i
b.q = m
m.o = g
m.r = h
m.p = a
e.z = a
e.u = a
e.t = a
e.w = b
e.v = g
g.t = i
g.r = f
g.p = h
i.o = e
i.w = f
i.p = m
i.t = a
n.o = h
n.u = m
f.t = i
f.r = g
f.p = h
assert f.t.t.q.r.x.w.txt == "b"