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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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