class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.v: F = None
        self.r: A = None
        self.u: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.q: G = None
        self.y: G = None
        self.r: B = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.w: E = None
        self.r: D = None
        self.s: A = None
        self.z: G = None
        self.txt = txt

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

n = A("n")
l = B("l")
i = C("i")
f = D("f")
a = E("a")
k = F("k")
d = G("d")

n.r = k
n.z = d
l.z = f
l.p = d
l.v = k
l.u = k
l.r = n
l.w = n
i.t = f
i.x = k
i.q = d
i.y = d
i.p = d
i.r = l
i.z = n
f.q = n
f.z = k
a.r = n
a.u = n
a.q = l
a.z = d
k.v = n
k.s = n
k.o = a
k.w = a
k.r = f
k.z = d
d.q = f
d.p = l
assert l.p.p.w.z.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.v: F = None
        self.r: A = None
        self.u: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.q: G = None
        self.y: G = None
        self.r: B = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.w: E = None
        self.r: D = None
        self.s: A = None
        self.z: G = None
        self.txt = txt

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

n = A("n")
l = B("l")
i = C("i")
f = D("f")
a = E("a")
k = F("k")
d = G("d")

n.r = k
n.z = d
l.z = f
l.p = d
l.v = k
l.u = k
l.r = n
l.w = n
i.t = f
i.x = k
i.q = d
i.y = d
i.p = d
i.r = l
i.z = n
f.q = n
f.z = k
a.r = n
a.u = n
a.q = l
a.z = d
k.v = n
k.s = n
k.o = a
k.w = a
k.r = f
k.z = d
d.q = f
d.p = l
assert l.p.p.w.z.p.w.txt == "n"