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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.y: D = None
        self.p: A = None
        self.q: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.y: D = None
        self.p: A = None
        self.q: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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