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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.s: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

g = A("g")
d = B("d")
h = C("h")
l = D("l")
m = E("m")
b = F("b")
i = G("i")
j = E("j")
a = B("a")
f = B("f")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.s: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

g = A("g")
d = B("d")
h = C("h")
l = D("l")
m = E("m")
b = F("b")
i = G("i")
j = E("j")
a = B("a")
f = B("f")

g.v = m
g.o = b
g.w = l
g.p = h
g.q = h
g.r = h
d.v = h
d.x = h
d.s = l
d.r = f
h.t = g
l.w = j
l.x = b
l.v = a
m.t = l
b.o = l
b.x = i
b.v = j
b.w = g
i.z = b
i.w = g
j.t = l
a.v = h
a.x = h
a.s = l
a.r = d
f.v = h
f.x = h
f.s = l
f.r = d
assert a.r.r.s.w.t.x.w.o.txt == "b"