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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: D = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: A = None
        self.z: B = None
        self.r: C = None
        self.o: E = None
        self.x: G = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: D = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: A = None
        self.z: B = None
        self.r: C = None
        self.o: E = None
        self.x: G = None
        self.w: B = None
        self.txt = txt

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

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