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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: A = None
        self.r: G = None
        self.q: D = None
        self.y: A = None
        self.o: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.w: F = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

e = A("e")
j = B("j")
k = C("k")
g = D("g")
d = E("d")
c = F("c")
i = G("i")
n = A("n")

e.w = n
j.z = n
j.p = n
k.p = i
k.y = g
g.y = k
g.s = e
g.r = c
g.q = d
d.v = e
c.x = g
c.q = g
c.v = g
c.p = n
c.r = i
c.o = i
c.y = e
i.p = k
i.r = d
i.w = c
i.x = e
i.q = g
n.w = e
assert d.v.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: A = None
        self.r: G = None
        self.q: D = None
        self.y: A = None
        self.o: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.w: F = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

e = A("e")
j = B("j")
k = C("k")
g = D("g")
d = E("d")
c = F("c")
i = G("i")
n = A("n")

e.w = n
j.z = n
j.p = n
k.p = i
k.y = g
g.y = k
g.s = e
g.r = c
g.q = d
d.v = e
c.x = g
c.q = g
c.v = g
c.p = n
c.r = i
c.o = i
c.y = e
i.p = k
i.r = d
i.w = c
i.x = e
i.q = g
n.w = e
assert d.v.w.w.w.w.w.w.txt == "e"