class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: D = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.w: B = None
        self.x: B = None
        self.r: I = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: B = None
        self.o: C = None
        self.x: E = None
        self.p: I = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.p: F = None
        self.q: B = None
        self.s: I = None
        self.u: A = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: H = None
        self.txt = txt

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

h.w = b
h.s = b
h.p = g
a.z = e
d.s = b
g.t = a
g.z = e
g.x = j
g.w = n
g.r = h
g.o = c
g.v = d
c.q = e
c.z = d
c.p = d
c.w = a
c.x = a
c.v = a
c.r = n
e.v = d
e.y = c
e.w = h
e.r = b
j.z = n
j.p = n
j.q = a
j.o = d
j.x = c
j.s = h
b.o = e
b.p = e
b.v = a
b.q = a
b.s = n
b.u = h
b.y = g
b.z = j
n.w = h
n.t = b
assert n.w.w.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: D = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.w: B = None
        self.x: B = None
        self.r: I = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: B = None
        self.o: C = None
        self.x: E = None
        self.p: I = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.p: F = None
        self.q: B = None
        self.s: I = None
        self.u: A = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: H = None
        self.txt = txt

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

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