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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

l.v = a
l.o = h
l.z = f
l.w = n
l.u = n
c.w = i
c.u = n
b.s = g
b.q = g
b.p = f
b.o = l
n.r = l
f.r = i
a.v = c
a.o = c
a.q = d
h.z = c
h.x = c
h.p = l
h.u = l
h.v = g
h.y = g
d.v = i
d.o = h
d.z = f
d.w = n
d.u = n
g.s = b
g.q = b
g.p = f
g.o = d
i.v = c
i.o = c
i.q = l
assert l.w.r.w.r.z.r.q.v.v.txt == "c"