class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: B = None
        self.v: C = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.x: A = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

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

n = A("n")
h = B("h")
i = C("i")
g = D("g")
e = E("e")
a = F("a")
d = G("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.x: A = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

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

n = A("n")
h = B("h")
i = C("i")
g = D("g")
e = E("e")
a = F("a")
d = G("d")

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