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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.w: C = None
        self.z: C = None
        self.y: C = None
        self.s: F = None
        self.o: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.w: C = None
        self.z: C = None
        self.y: C = None
        self.s: F = None
        self.o: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: F = None
        self.txt = txt

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

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