class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: A = None
        self.u: C = None
        self.x: B = None
        self.o: C = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: E = None
        self.q: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: A = None
        self.u: C = None
        self.x: B = None
        self.o: C = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: E = None
        self.q: E = None
        self.w: C = None
        self.txt = txt

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

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