class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.o: C = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.o: D = None
        self.v: A = None
        self.w: A = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.x: F = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.s: D = None
        self.w: B = None
        self.t: D = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

h = A("h")
l = B("l")
j = C("j")
m = D("m")
d = E("d")
i = F("i")
k = G("k")
n = F("n")

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.o: D = None
        self.v: A = None
        self.w: A = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.x: F = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.s: D = None
        self.w: B = None
        self.t: D = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

h = A("h")
l = B("l")
j = C("j")
m = D("m")
d = E("d")
i = F("i")
k = G("k")
n = F("n")

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