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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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