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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.o: H = None
        self.y: A = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: H = None
        self.v: H = None
        self.s: C = None
        self.y: A = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.o: C = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.o: H = None
        self.y: A = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: H = None
        self.v: H = None
        self.s: C = None
        self.y: A = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.o: C = None
        self.z: B = None
        self.txt = txt

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

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