class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: E = None
        self.x: E = None
        self.w: B = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.u: E = None
        self.txt = txt

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

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