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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: C = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

n = A("n")
d = B("d")
l = C("l")
c = D("c")
a = E("a")
i = F("i")
b = G("b")
h = E("h")
j = F("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: C = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

n = A("n")
d = B("d")
l = C("l")
c = D("c")
a = E("a")
i = F("i")
b = G("b")
h = E("h")
j = F("j")

n.w = a
d.v = a
l.x = c
l.r = c
c.s = i
c.p = l
c.y = l
c.v = a
a.p = h
i.r = j
i.x = j
i.u = c
i.t = c
i.s = h
i.p = d
i.y = n
b.u = c
b.y = a
b.x = d
b.q = l
h.p = a
j.r = i
j.x = i
j.u = c
j.t = c
j.s = a
j.p = d
j.y = n
assert h.p.p.p.p.p.p.p.p.p.txt == "a"