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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.x: F = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.x: F = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

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

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