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

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

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

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

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

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

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

n = A("n")
d = B("d")
j = C("j")
i = D("i")
m = E("m")
e = F("e")
a = G("a")
c = G("c")
k = G("k")
g = D("g")

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

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

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

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

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

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

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

n = A("n")
d = B("d")
j = C("j")
i = D("i")
m = E("m")
e = F("e")
a = G("a")
c = G("c")
k = G("k")
g = D("g")

n.u = a
n.x = a
n.r = e
n.q = m
n.z = d
d.w = m
d.r = j
d.x = n
d.v = n
d.z = e
j.t = a
i.w = g
i.y = j
i.x = n
i.p = c
m.o = e
m.q = d
e.r = g
e.z = n
a.r = m
a.z = n
a.v = d
a.u = j
a.p = c
c.r = m
c.z = n
c.v = d
c.u = j
c.p = a
k.r = m
k.z = n
k.v = d
k.u = j
k.p = c
g.w = i
g.y = j
g.x = n
g.p = a
assert a.r.o.r.x.z.w.o.z.q.q.txt == "d"