class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: B = None
        self.x: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: D = None
        self.w: F = None
        self.z: E = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: H = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: H = None
        self.x: D = None
        self.q: C = None
        self.s: E = None
        self.t: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: D = None
        self.z: D = None
        self.q: E = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
i = C("i")
e = D("e")
b = E("b")
j = F("j")
n = G("n")
c = H("c")

h.s = n
h.w = n
h.r = g
h.x = i
g.r = b
i.q = c
i.p = e
i.w = j
i.u = j
i.z = b
i.x = h
e.q = i
e.t = g
e.x = b
b.s = h
b.x = c
b.v = e
j.p = n
j.t = n
j.u = c
j.x = e
j.q = i
j.w = i
j.s = b
n.u = j
c.v = g
c.t = e
c.z = e
c.q = b
c.w = h
assert i.p.x.v.t.r.s.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: B = None
        self.x: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: D = None
        self.w: F = None
        self.z: E = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: H = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: H = None
        self.x: D = None
        self.q: C = None
        self.s: E = None
        self.t: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: D = None
        self.z: D = None
        self.q: E = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
i = C("i")
e = D("e")
b = E("b")
j = F("j")
n = G("n")
c = H("c")

h.s = n
h.w = n
h.r = g
h.x = i
g.r = b
i.q = c
i.p = e
i.w = j
i.u = j
i.z = b
i.x = h
e.q = i
e.t = g
e.x = b
b.s = h
b.x = c
b.v = e
j.p = n
j.t = n
j.u = c
j.x = e
j.q = i
j.w = i
j.s = b
n.u = j
c.v = g
c.t = e
c.z = e
c.q = b
c.w = h
assert i.p.x.v.t.r.s.w.u.txt == "j"