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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: A = None
        self.u: H = None
        self.y: E = None
        self.r: E = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.v: H = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

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

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

h = A("h")
f = B("f")
l = C("l")
n = D("n")
m = E("m")
i = F("i")
d = G("d")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: A = None
        self.u: H = None
        self.y: E = None
        self.r: E = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.v: H = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

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

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

h = A("h")
f = B("f")
l = C("l")
n = D("n")
m = E("m")
i = F("i")
d = G("d")
g = H("g")

h.q = g
h.r = m
h.w = l
h.p = f
h.y = f
h.x = d
f.v = g
f.u = g
f.s = h
f.w = h
f.y = m
f.r = m
f.q = l
l.v = h
l.u = h
n.w = d
n.q = d
n.p = i
n.u = i
n.v = g
m.z = l
m.x = i
m.v = i
m.y = f
i.p = f
i.u = l
i.t = h
i.o = d
i.s = d
d.u = h
d.t = m
g.w = l
assert i.s.t.x.t.txt == "h"