class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: G = None
        self.u: B = None
        self.w: G = None
        self.t: A = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: G = None
        self.u: B = None
        self.w: G = None
        self.t: A = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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