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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.p: D = None
        self.z: G = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.p: D = None
        self.z: G = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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