class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.u: F = None
        self.p: E = None
        self.t: A = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.s: F = None
        self.u: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

a.s = g
g.y = h
g.o = l
g.x = l
g.r = c
i.y = b
i.u = b
i.x = l
i.p = l
i.t = a
i.r = a
i.s = k
h.r = g
e.v = k
e.w = l
e.p = l
e.r = g
e.z = f
e.q = b
e.x = b
b.o = i
b.q = i
b.z = g
b.v = a
k.w = c
k.p = a
k.u = a
k.x = a
k.s = b
k.t = g
c.y = h
c.o = l
c.x = l
c.r = g
l.v = k
l.w = e
l.p = e
l.r = g
l.z = f
l.q = b
l.x = b
f.r = g
assert f.r.x.x.z.y.r.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.u: F = None
        self.p: E = None
        self.t: A = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.s: F = None
        self.u: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

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