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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.u: G = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.z: E = None
        self.v: B = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.u: G = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.z: E = None
        self.v: B = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: G = None
        self.txt = txt

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

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

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