class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: H = None
        self.s: E = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: B = None
        self.o: A = None
        self.p: C = None
        self.z: E = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: H = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: H = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: G = None
        self.w: E = None
        self.s: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: H = None
        self.u: B = None
        self.y: B = None
        self.v: C = None
        self.w: C = None
        self.q: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: B = None
        self.o: A = None
        self.p: C = None
        self.z: E = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: H = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: H = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: G = None
        self.w: E = None
        self.s: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: H = None
        self.u: B = None
        self.y: B = None
        self.v: C = None
        self.w: C = None
        self.q: H = None
        self.txt = txt

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

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

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