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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
f = B("f")
l = C("l")
m = D("m")
e = E("e")
j = F("j")
c = G("c")
n = H("n")
h = G("h")

a.p = h
a.y = f
a.r = m
a.u = m
a.z = l
f.u = n
f.w = n
f.y = e
f.p = e
f.o = e
f.q = j
l.s = h
l.u = c
m.p = e
m.q = f
e.z = c
e.q = a
e.y = f
j.v = f
j.u = c
j.s = l
j.z = a
j.q = m
j.y = h
c.s = a
c.o = e
c.q = n
n.t = e
n.q = c
n.z = l
n.r = f
h.s = a
h.o = e
h.q = n
assert j.u.q.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.r: D = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
f = B("f")
l = C("l")
m = D("m")
e = E("e")
j = F("j")
c = G("c")
n = H("n")
h = G("h")

a.p = h
a.y = f
a.r = m
a.u = m
a.z = l
f.u = n
f.w = n
f.y = e
f.p = e
f.o = e
f.q = j
l.s = h
l.u = c
m.p = e
m.q = f
e.z = c
e.q = a
e.y = f
j.v = f
j.u = c
j.s = l
j.z = a
j.q = m
j.y = h
c.s = a
c.o = e
c.q = n
n.t = e
n.q = c
n.z = l
n.r = f
h.s = a
h.o = e
h.q = n
assert j.u.q.t.q.txt == "a"