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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.u: A = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.u: A = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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