class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.y: F = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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