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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: F = None
        self.p: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: G = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.w: D = None
        self.q: E = None
        self.y: G = None
        self.txt = txt

k = A("k")
l = B("l")
m = C("m")
e = D("e")
f = E("f")
a = F("a")
n = G("n")
i = H("i")

k.z = a
l.z = f
l.s = k
l.y = k
l.q = a
l.x = a
l.o = e
m.u = i
m.s = e
e.o = m
e.z = a
e.p = l
e.y = i
f.p = e
f.y = e
a.r = e
a.x = e
a.z = e
a.y = n
n.p = l
i.o = l
i.z = l
i.w = e
i.q = f
i.y = n
assert m.u.w.y.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: F = None
        self.p: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: G = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.w: D = None
        self.q: E = None
        self.y: G = None
        self.txt = txt

k = A("k")
l = B("l")
m = C("m")
e = D("e")
f = E("f")
a = F("a")
n = G("n")
i = H("i")

k.z = a
l.z = f
l.s = k
l.y = k
l.q = a
l.x = a
l.o = e
m.u = i
m.s = e
e.o = m
e.z = a
e.p = l
e.y = i
f.p = e
f.y = e
a.r = e
a.x = e
a.z = e
a.y = n
n.p = l
i.o = l
i.z = l
i.w = e
i.q = f
i.y = n
assert m.u.w.y.y.p.txt == "l"