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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: D = None
        self.x: C = None
        self.r: B = None
        self.w: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.w: E = None
        self.q: E = None
        self.y: B = None
        self.o: A = None
        self.txt = txt

k = A("k")
f = B("f")
i = C("i")
c = D("c")
j = E("j")
n = F("n")
b = G("b")
h = G("h")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: D = None
        self.x: C = None
        self.r: B = None
        self.w: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.w: E = None
        self.q: E = None
        self.y: B = None
        self.o: A = None
        self.txt = txt

k = A("k")
f = B("f")
i = C("i")
c = D("c")
j = E("j")
n = F("n")
b = G("b")
h = G("h")

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