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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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