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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.p: G = None
        self.q: E = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.u: G = None
        self.r: G = None
        self.v: E = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.p: G = None
        self.q: E = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.u: G = None
        self.r: G = None
        self.v: E = None
        self.t: F = None
        self.txt = txt

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

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

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

c.v = g
c.q = a
g.v = f
g.r = b
g.u = i
g.p = i
g.t = e
g.x = n
f.x = d
f.o = d
f.p = b
f.s = b
f.q = i
f.z = g
n.q = i
n.z = a
n.s = b
n.o = f
i.y = c
i.z = e
i.u = b
i.r = b
i.v = d
i.t = j
a.q = c
b.v = g
b.z = c
e.q = c
d.y = c
d.z = e
d.u = b
d.r = b
d.v = i
d.t = j
j.q = c
assert d.v.y.v.t.q.q.q.v.r.txt == "b"