class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.y: G = None
        self.p: G = None
        self.r: G = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.p: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.p: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

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

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