class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.o: E = None
        self.q: H = None
        self.w: C = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: H = None
        self.u: H = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.w: G = None
        self.z: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.x: D = None
        self.o: B = None
        self.z: E = None
        self.q: H = None
        self.s: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.w: B = None
        self.x: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: H = None
        self.u: H = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.w: G = None
        self.z: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.x: D = None
        self.o: B = None
        self.z: E = None
        self.q: H = None
        self.s: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.w: B = None
        self.x: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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