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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.z: C = None
        self.u: B = None
        self.o: F = None
        self.q: A = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.o: C = None
        self.z: B = None
        self.y: G = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.z: C = None
        self.u: B = None
        self.o: F = None
        self.q: A = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.o: C = None
        self.z: B = None
        self.y: G = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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