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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: C = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.t: D = None
        self.p: D = None
        self.s: C = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: C = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.t: D = None
        self.p: D = None
        self.s: C = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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