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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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