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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.s: B = None
        self.txt = txt

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

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

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