class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.y: D = None
        self.u: D = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.y: H = None
        self.o: C = None
        self.p: E = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.r: E = None
        self.u: C = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: A = None
        self.v: A = None
        self.r: G = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.t: D = None
        self.o: C = None
        self.y: H = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.y: H = None
        self.o: C = None
        self.p: E = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.r: E = None
        self.u: C = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: A = None
        self.v: A = None
        self.r: G = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.t: D = None
        self.o: C = None
        self.y: H = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.q: G = None
        self.txt = txt

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

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