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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.s: C = None
        self.p: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.y: F = None
        self.w: D = None
        self.t: C = None
        self.p: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.r: C = None
        self.q: F = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

n = A("n")
h = B("h")
f = C("f")
j = D("j")
l = E("l")
a = F("a")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.s: C = None
        self.p: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.y: F = None
        self.w: D = None
        self.t: C = None
        self.p: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.r: C = None
        self.q: F = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

n = A("n")
h = B("h")
f = C("f")
j = D("j")
l = E("l")
a = F("a")
e = G("e")

n.w = a
n.o = a
n.v = a
n.s = e
n.t = f
h.u = n
h.x = j
h.s = f
h.p = l
h.y = l
f.x = l
j.s = n
j.y = e
j.x = f
l.r = f
l.t = f
l.x = j
l.w = j
l.y = a
l.p = e
l.o = h
a.o = n
a.y = f
a.p = e
e.o = a
e.w = a
e.q = a
e.r = f
e.p = f
e.x = h
assert l.o.x.s.s.x.txt == "h"