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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.v: C = None
        self.x: F = None
        self.w: G = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.t: F = None
        self.z: D = None
        self.r: F = None
        self.v: D = None
        self.txt = txt

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

j = A("j")
d = B("d")
n = C("n")
g = D("g")
c = E("c")
b = F("b")
k = G("k")
e = A("e")
h = F("h")

j.r = k
j.p = e
j.v = e
j.z = n
d.u = g
d.s = j
d.o = e
n.x = h
n.w = d
n.u = d
n.v = c
n.y = g
n.r = k
n.z = e
g.t = n
c.p = n
c.v = n
c.u = d
c.x = h
c.w = k
c.y = g
c.z = b
b.u = n
b.s = h
b.t = h
b.r = h
b.z = g
b.v = g
k.p = h
k.w = b
e.r = k
e.p = j
e.v = j
e.z = n
h.u = n
h.s = b
h.t = b
h.r = b
h.z = g
h.v = g
assert d.o.v.r.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.v: C = None
        self.x: F = None
        self.w: G = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.t: F = None
        self.z: D = None
        self.r: F = None
        self.v: D = None
        self.txt = txt

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

j = A("j")
d = B("d")
n = C("n")
g = D("g")
c = E("c")
b = F("b")
k = G("k")
e = A("e")
h = F("h")

j.r = k
j.p = e
j.v = e
j.z = n
d.u = g
d.s = j
d.o = e
n.x = h
n.w = d
n.u = d
n.v = c
n.y = g
n.r = k
n.z = e
g.t = n
c.p = n
c.v = n
c.u = d
c.x = h
c.w = k
c.y = g
c.z = b
b.u = n
b.s = h
b.t = h
b.r = h
b.z = g
b.v = g
k.p = h
k.w = b
e.r = k
e.p = j
e.v = j
e.z = n
h.u = n
h.s = b
h.t = b
h.r = b
h.z = g
h.v = g
assert d.o.v.r.w.r.txt == "h"