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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: B = None
        self.y: B = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.p: A = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
n = B("n")
f = C("f")
l = D("l")
g = E("g")
k = F("k")
i = G("i")
d = A("d")
e = F("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: B = None
        self.y: B = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.p: A = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
n = B("n")
f = C("f")
l = D("l")
g = E("g")
k = F("k")
i = G("i")
d = A("d")
e = F("e")

h.y = g
h.t = f
h.p = f
h.s = i
h.o = n
h.w = n
n.o = l
f.s = h
l.o = n
l.q = d
l.t = d
g.o = e
g.u = n
g.y = n
g.r = n
g.s = n
k.y = g
k.o = f
k.x = f
k.p = d
k.u = n
i.z = k
i.x = e
i.q = g
i.s = l
d.y = g
d.t = f
d.p = f
d.s = i
d.o = n
d.w = n
e.y = g
e.o = f
e.x = f
e.p = h
e.u = n
assert d.t.s.s.s.q.w.txt == "n"