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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.s: B = None
        self.p: E = None
        self.r: H = None
        self.v: F = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.t: G = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: D = None
        self.t: H = None
        self.u: G = None
        self.v: D = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.z: B = None
        self.o: B = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.s: B = None
        self.p: E = None
        self.r: H = None
        self.v: F = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.t: G = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: D = None
        self.t: H = None
        self.u: G = None
        self.v: D = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.z: B = None
        self.o: B = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

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

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