class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: G = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: F = None
        self.y: E = None
        self.q: A = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: F = None
        self.y: E = None
        self.q: A = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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