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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

e = A("e")
m = B("m")
f = C("f")
i = D("i")
k = E("k")
c = F("c")
b = G("b")
n = G("n")
l = C("l")
h = F("h")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

e = A("e")
m = B("m")
f = C("f")
i = D("i")
k = E("k")
c = F("c")
b = G("b")
n = G("n")
l = C("l")
h = F("h")

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