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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.t: E = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.t: E = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

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

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