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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: B = None
        self.w: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: E = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: B = None
        self.w: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: E = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

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

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