class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.r: F = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.p: B = None
        self.x: G = None
        self.s: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.s: F = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.p: B = None
        self.x: G = None
        self.s: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.s: F = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

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