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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.s: F = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.s: F = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

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

n.y = l
e.z = c
d.p = a
c.x = k
c.u = k
c.y = d
c.s = j
a.x = e
a.v = b
a.u = j
b.y = a
b.w = c
b.t = e
b.x = d
k.v = c
k.q = c
k.y = n
k.p = d
l.y = a
l.w = c
l.t = e
l.x = d
j.y = a
j.w = c
j.t = e
j.x = d
assert e.z.u.y.y.x.p.txt == "a"