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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.z: D = None
        self.o: H = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.z: D = None
        self.o: H = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

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

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