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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
i = C("i")
j = D("j")
c = E("c")
b = F("b")
g = B("g")
k = F("k")
m = D("m")
a = A("a")

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
i = C("i")
j = D("j")
c = E("c")
b = F("b")
g = B("g")
k = F("k")
m = D("m")
a = A("a")

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