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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.v: F = None
        self.u: G = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.o: G = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
d = C("d")
b = D("b")
m = E("m")
g = F("g")
i = G("i")
a = C("a")
k = A("k")

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.v: F = None
        self.u: G = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.o: G = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
d = C("d")
b = D("b")
m = E("m")
g = F("g")
i = G("i")
a = C("a")
k = A("k")

n.r = k
n.y = i
n.x = a
n.w = a
h.x = i
h.t = a
d.o = n
d.p = b
d.v = g
d.r = g
d.u = i
d.x = i
b.z = g
m.u = b
m.z = b
m.o = i
m.v = h
m.y = h
g.w = i
g.x = k
i.p = k
i.w = g
a.o = n
a.p = b
a.v = g
a.r = g
a.u = i
a.x = i
k.r = n
k.y = i
k.x = a
k.w = d
assert h.x.p.r.y.p.r.y.w.txt == "g"