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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: G = None
        self.q: C = None
        self.t: C = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: E = None
        self.x: G = None
        self.q: E = None
        self.z: E = None
        self.r: A = None
        self.txt = txt

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

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

e.v = k
e.x = f
h.x = e
h.p = e
l.v = h
l.z = f
l.q = g
l.t = g
l.s = b
b.v = a
b.s = h
b.x = f
k.t = e
k.y = h
k.x = h
a.s = k
a.t = k
a.q = k
a.z = k
a.x = f
a.r = e
n.y = k
n.v = k
n.w = e
n.t = f
n.z = a
n.s = l
f.y = k
f.v = k
f.w = e
f.t = n
f.z = a
f.s = g
g.v = h
g.z = n
g.q = l
g.t = l
g.s = b
assert a.r.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: G = None
        self.q: C = None
        self.t: C = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: E = None
        self.x: G = None
        self.q: E = None
        self.z: E = None
        self.r: A = None
        self.txt = txt

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

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

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